#include<iostream>
#include<pthread.h>
#include<unistd.h>
using  std::endl;
using std::cout;


void *test1(void*arg)
{
    int n=4;
    while(n--)
    {
        sleep(1);
        cout<<"我是子线程  pid:"<<getpid()<<endl;
    }
    return (void*)"大nb";
}
int i=0;

int main()
{
    pthread_t thid;
    char* str=nullptr;
    int i=pthread_create(&thid,nullptr,test1,(char*)"钟哥无敌");
    pthread_join(thid,(void**)&str);
    cout<<str<<endl;
    return 0;
}